home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / util / misc / flib10.lha / FlushLib.DOC next >
Encoding:
Text File  |  1993-04-11  |  4.1 KB  |  89 lines

  1.  
  2. *************************************
  3. FlushLib version 1.0
  4. Copyright ©1993 by Roy van der Woning
  5. All rights reserved.
  6. *************************************
  7.  
  8.  
  9. 1. What is FlushLib?
  10.  
  11. FlushLib  is  a  small  utility  which  I  put together because I needed it
  12. myself.    Basically,   all  it  does  is  flush  a  shared  library  (like
  13. asl.library,  diskfont.library,  etc) from memory.  This is done by calling
  14. the  exec.library  function  RemLibrary()  for  the  library to be flushed.
  15. RemLibrary() in turn branches into the expunge vector of that library which
  16. initiates its removal from memory.
  17.  
  18.           ///////////////////////////////////////////////////////
  19.           // FLUSHLIB ONLY WORKS WITH OS VERSIONS 37 OR HIGHER //
  20.           ///////////////////////////////////////////////////////
  21.  
  22.  
  23. 2. Why would I want to use FlushLib?
  24.  
  25. The  normal  everyday  user  wouldn't  find FlushLib a very useful tool but
  26. software  developers  might  want  to take a second look at it.  It is very
  27. useful  if  you are developing shared libraries.  If your shared library is
  28. accessed for the first time it is loaded from the LIBS:  directory and then
  29. remains  in  memory  until someone tells it to get lost.  This usually only
  30. happens  when  you  end up in a low memory situation.  Otherwise, no matter
  31. how  many  times  you  modify  your  library  sourcecode  and  recompile or
  32. reassemble  it, the system keeps referring to the version in memory.  Thus,
  33. if you want to test your modified version, you would have to get rid of the
  34. version in memory first.  Wasn't that what FlushLib did?  :)
  35.  
  36.  
  37. 3. How do I use FlushLib?
  38.  
  39. The  usage  is  as  simple  as  can be.  Call FlushLib with the name of the
  40. library you want to be flushed and the rest is out of your hands.  :) There
  41. is  one switch that can go along with the libraryname:  FORCE.  This switch
  42. flushes the library even if it is still in use by one or more applications.
  43. Since  this  is  not  standard  procedure  and  potentially dangerous (your
  44. machine can crash) you should use this switch with extreme care and only if
  45. you know what you are doing.
  46.  
  47. An  example use for the switch would be a case where an application crashes
  48. before it gets a chance to close the libraries it opened.  Normally, if you
  49. requested  this  library  to be flushed, Exec would turn down your request,
  50. thinking that the library is still in use by the crashed application.  This
  51. is  true  but  crashed  applications  normally  don't make use of a library
  52. anymore.   :)  So you would want to flush the library forcibly by using the
  53. FORCE keyword.
  54.  
  55.  
  56. 4. Is it dangerous to fool around with FlushLib?
  57.  
  58. FlushLib  performs  a  number of sanity checks to make sure that everything
  59. happens  the  way  it  should.   First it checks if the library you want to
  60. flush  can  be  found in the Exec librarylist.  If so, the OpenCnt value of
  61. that  library is examined.  This value indicates the number of applications
  62. that  have  opened the library but have not closed it (yet).  If this value
  63. is  not  zero, someone is still using the library and it cannot be flushed.
  64. Otherwise,  an attempt is made to flush the library.  After this attempt, a
  65. renewed  lookup  is  performed  to  make sure that the library was actually
  66. removed  from the Exec library list.  After all, the library could indicate
  67. that  it  doesn't want to be flushed at all (by means of an "empty" expunge
  68. vector).    Diagnostic  messages  keep  you  informed  about  all  possible
  69. outcomes.
  70.  
  71.  
  72. 5. Can I use and distribute FlushLib?
  73.  
  74. Yes you can, even free of charge.  :) FlushLib is FreeWare and the original
  75. archive  may be copied, uploaded to Bulletin Board Systems, hatched in file
  76. distribution  networks, etc.  You may not do this with modified versions of
  77. the  archive,  either with files added or removed, nor may any of the files
  78. be enhanced, updated or otherwise modified.
  79.  
  80.  
  81. 6. What if it doesn't work?
  82.  
  83. I  would  appreciate  bugreports  on FlushLib to be sent to me through Fido
  84. netmail  at  2:283/705.7.   If you have bugreports or remarks for any of my
  85. other  projects,  please  note  that  my  FidoNet address has changed.  You
  86. should  use  the new address for any and all correspondence with me.  Happy
  87. developing!
  88.  
  89.